import 'package:flutter/cupertino.dart';

/// 控件初始化参数
class AmapOptions {
  //设置是否显示定位小蓝点，用于满足只想使用定位，不想使用定位小蓝点的场景，设置false以后图面上不再有定位蓝点的概念，但是会持续回调位置信息。
  bool showMyLocation;

  ////是否显示定位按钮
  bool myLocationButtonEnabled;

  //缩放等级
  int zoomTo;

  AmapOptions({
    @required this.showMyLocation,
    this.myLocationButtonEnabled = false,
    this.zoomTo = 17,
  });

  static AmapOptions fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    AmapOptions amapOptionsBean = AmapOptions();
    amapOptionsBean.showMyLocation = map['showMyLocation'];
    amapOptionsBean.myLocationButtonEnabled = map['myLocationButtonEnabled'];
    amapOptionsBean.zoomTo = map['zoomTo'];
    return amapOptionsBean;
  }

  Map toJson() => {
        "showMyLocation": showMyLocation,
        "myLocationButtonEnabled": myLocationButtonEnabled,
        "zoomTo": zoomTo,
      };
}
